package com.zy.hospitalward_management_system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zy.hospitalward_management_system.pojo.Inpatientward;
import com.zy.hospitalward_management_system.mapper.InpatientwardMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zy
 * @since 2021-01-26
 */
@Service
public class InpatientwardServiceImpl extends ServiceImpl<InpatientwardMapper, Inpatientward> implements IService<Inpatientward> {

    @Resource
    InpatientwardMapper inpatientwardMapper;


    /**
     * 传入科室ID 查询该科室所有 可用(capacity!=4 的房间
     * @param DepartmentId
     * @return
     */
    public List<Inpatientward> queryInpatientwardsByDepartmentId(int DepartmentId){
        List<Inpatientward> inpatientwards = inpatientwardMapper.selectList(new QueryWrapper<Inpatientward>().eq("department_id", DepartmentId));
        return inpatientwards;
    }

}
